<?php
namespace app\validate;

use app\base\BaseValidate;

/**
 * 验证器-CompanyArticleValidate
 * Class StoreValidate
 * @package app\validate
 */
class CompanyArticleValidate extends BaseValidate
{
    protected $rule = [
        'id|图文id' => 'require|number|notIn:0',
        'title|标题' => 'require|max:30',
        'is_hot|是否热门' => 'number|in:0,1',
        'status|状态' => 'number|in:0,1',
        'desc|描述' => 'max:200',

    ];

    //验证场景-上线状态
    public function sceneUpStatus()
    {
        return $this->only(['id','status']);
    }


    //验证场景-热门状态
    public function sceneUpHot()
    {
        return $this->only(['id','is_hot']);
    }
}
